home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / RGASM.RAR / ASMCODE.EXE / CHAPT6 / NUMLOFF.ASM < prev    next >
Encoding:
Assembly Source File  |  1994-08-27  |  1.7 KB  |  47 lines

  1.  
  2. page 60,132
  3. ;
  4. ;                  PROGRAM NumlOff
  5. ;                     Chapter 6
  6. ;
  7. ;              30 Nov 1991, Voronezh
  8. ;
  9. ;       This is  a  sample  of  BIOS  data  usage.   This
  10. ;       program turns off the NumLock state.  It is known
  11. ;       that the extended  AT  keyboard  held the NumLock
  12. ;       state after DOS  had finished loading.  Executing
  13. ;       this  programt  you  may  turn  the  NumLock  off
  14. ;       without any  key  pressing.  Sometimes it  may be
  15. ;       useful  to  include the  following line  in  your
  16. ;       AUTOEXEC.BAT file:
  17. ;
  18. ;       NumLOff
  19. ;
  20. ;       If you decide  to do this, include the executable
  21. ;       module   of   this   program   (NumlOff.COM    or
  22. ;       NumlOff.EXE) in any directory that is in the path
  23. ;       during the DOS loading process.
  24. ;
  25. .model tiny                             ; The TINY memory model
  26.                     ; is needed to build
  27.                     ; the COM- program
  28.  
  29. BiosData        segment at 40h          ; BIOS data definition
  30.     org     17h                     ; Keyboard flags from address 0417h
  31. KbdSt1  db      ?                       ; Keyboard_status byte 1
  32. KbdSt2  db      ?                       ; Keyboard_status byte 2
  33. BiosData        ends                    ; End of BIOS data
  34.  
  35. .code                                   ; CODE segment starts here
  36. begin:
  37.     assume  es:BiosData             ; BIOS data area will be accessed
  38.                     ;   through register ES
  39.     mov     ax,BiosData             ; Load address of BIOS data segment
  40.     mov     es,ax                   ;    into AX and copy it into ES
  41.     and     KbdSt1,0DFh             ; Clear the NUMLOCK status (bit 5)
  42.  
  43.     mov     ax,4C00h                ; Set the exit code 0
  44.     int     21h                     ; and return to DOS
  45.  
  46.     end     begin
  47.